﻿using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using UnityEngine.UI;
public class UIController : MonoBehaviour, IObserver<DataType> {
	public Text _text;

	public ISubject<DataType> Publisher { get; set; }

	public void Subscriber (DataType data) {
		_text.text = string.Format ("{0} : {1}", data.name, data.pos);
	}
	void Start () {
		Publisher = FindObjectOfType<Ball> ();
		Publisher.PublicAction += Subscriber;
	}
}